import request from '@/router/axios';

// 领料单分页接口
export const getList = (current, size, params) => {
  return request({
    url: `/api/mes-warehouse/v2/sheetheader/ro/page`,
    method: 'post',
    params: {
      current,
      size
    },
    data: {
      ...params
    }
  });
};

// 领料单详情接口
export const getDetail = (sheetId) => {
  return request({
    url: '/api/mes-warehouse/v2/sheetheader/sheet/detail',
    method: 'get',
    params: {
      sheetId
    }
  });
};
// 领料单页面出库弹窗分页
export const getOutboundList = (current, size, params) => {
  return request({
    url: `/api/mes-warehouse/v2/sheetheader/outbound/page`,
    method: 'post',
    params: {
      current,
      size
    },
    data: {
      ...params
    }
  });
};

// 领料单出库接口
export const handleInventory = (data) => {
  return request({
    url: '/api/mes-warehouse/inventory/handle',
    method: 'post',
    data
  });
};

// 工单详情
export const getDetailByOrderNo = (orderNo) => {
  return request({
    url: '/api/mes-product/work-order/detail',
    method: 'get',
    params: {
      orderNo
    }
  });
};

// 领料单包装详情
export const getPackBoxDetail = (sheetId) => {
  return request({
    url: '/api/mes-warehouse/v2/sheetheader/packing/detail',
    method: 'get',
    params: {
      sheetId
    }
  });
};
